<template>
  <div class="mt-4">
    <el-input v-model="trainno" placeholder="请输入车次信息" class="input-with-select">
      <template #append>
        <el-button @click="btn_loadbyno" :icon="Search" />
      </template>
    </el-input>
  </div>
</template>

<script setup lang="ts">
import { Search } from '@element-plus/icons-vue'
//pinia

//先在stores文件夹中创建js
//引入
import { useScheduleStore } from '../../stores/schedule'
//引入storeToRefs
import { storeToRefs } from 'pinia'

//实例化对象
const scheduleStore = useScheduleStore()

const btn_loadbyno = () => {

  //函数用 对象.调用
  scheduleStore.loadbyno()
}

//属性用 storeToRefs(scheduleStore) 解构
const { trainno } = storeToRefs(scheduleStore)
// log输出为其他类型
// console.log(trainno);



</script>

<style>
.input-with-select .el-input-group__prepend {
  background-color: var(--el-fill-color-blank);
}
</style>
